package br.com.escolaespacocrianca.fineec.component;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class EncryptHandling {

	public static String encrypt(String stringToEncrypt) {
		
		MessageDigest mdEnc = null;
		try {
			mdEnc = MessageDigest.getInstance("MD5");
			mdEnc.update(stringToEncrypt.getBytes(), 0, stringToEncrypt.length());
			return new BigInteger(1, mdEnc.digest()).toString(16);
		} catch (NoSuchAlgorithmException e) {
			return null;
		}
	}

	
	
}
